package day6;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * @author oldliu
 * @since 1.0
 */
public class FileStream2 {
    public static void main(String[] args) {
        FileInputStream fin=null;
        try {
            fin = new FileInputStream("E:\\temp\\java75\\namelist.txt");
            byte b[]=new byte[20];
            int len=0;
            //len= fin.read(b);//读了多少个
            while ((len=fin.read(b))!=-1){
                String str=new String(b,0,len);
                System.out.println(str);
            }

            fin.close();//不合适
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
